/* 引入封装方法 */
import {get,post} from './index'
/* ============菜单管理============== */
//菜单添加的接口
export const addMenu = (data)=>post('/menuadd',data)
//菜单列表的接口
export const getMenuList = ()=>get('/menulist?istree=true')
//菜单删查接口
export const delMenu = data =>post('/menudelete',data)
//菜单列表一条数据的接口
export const getMenuInfo = (data)=>get('/menuinfo',data)
//菜单编辑的接口
export const editMenu = (data)=>post('/menuedit',data)
/* ============角色管理============== */
//角色添加的接口
export const addRole = (data)=>post('/roleadd',data)
//角色列表的接口
export const getRoleList = ()=>get('/rolelist')
//角色删查接口
export const delRole = data =>post('/roledelete',data)
//角色列表一条数据的接口
export const getRoleInfo = (data)=>get('/roleinfo',data)
//角色编辑的接口
export const editRole = (data)=>post('/roleedit',data)
/* ============管理员管理============== */
//管理员列表
export const userlist = params=>get('/userlist',params)
//管理员的添加
export const useradd =data=>post('/useradd',data)
//管理员的删除
export const userdelete =data=>post('/userdelete',data)
//管理员的编辑
export const useredit =data=>post('/useredit',data)
//管理员获取（一条）
export const userinfo =params=>get('/userinfo',params)
//管理员总数查询
export const usercount =()=>get('/usercount')
//管理员的登录
export const userlogin =data=>post('/userlogin',data)
/* ============商品分类管理============== */
// 封装一个分类添加的接口
export const cateAdd = data=>post('/cateadd',data,true)
// 封装一个分类列表的接口
export const cateList = data=>get('/catelist',data)
// 封装一个分类删除的接口
export const cateDel = data=>post('/catedelete',data)
// 封装一个分类列表的接口 一条数据
export const cateInfo = data=>get('/cateinfo',data)
// 封装一个分类编辑的接口
export const cateEdit = data=>post('/cateedit',data,true)
/* =========商品规格属性接口=========== */
//商品规格属性列表
export const specslist = params=>get('/specslist',params)
//商品规格属性的添加
export const specsadd =data=>post('/specsadd',data)
//商品规格属性的删除
export const specsdelete =data=>post('/specsdelete',data)
//商品规格属性的编辑
export const specsedit =data=>post('/specsedit',data)
//商品规格属性获取（一条）
export const specsinfo =params=>get('/specsinfo',params)
//商品规格属性总数查询
export const specscount =()=>get('/specscount')
/* =========商品接口=========== */
//商品列表
export const goodslist = params=>get('/goodslist',params)
//商品的添加
export const goodsadd =data=>post('/goodsadd',data,true)
//商品的删除
export const goodsdelete =data=>post('/goodsdelete',data)
//商品的编辑
export const goodsedit =data=>post('/goodsedit',data,true)
//商品获取（一条）
export const goodsinfo =params=>get('/goodsinfo',params)
//商品总数查询
export const goodscount =()=>get('/goodscount')
/* =========会员管理接口=========== */
//会员列表
export const memberlist = params=>get('/memberlist',params)
//会员获取
export const memberinfo = params=>get('/memberinfo',params)
//会员修改
export const memberedit =data=>post('/memberedit',data)
/* =========轮播图管理接口=========== */
//轮播图列表
export const bannerList = () => get('/bannerlist')
//轮播图添加
export const bannerAdd = data => post('/banneradd', data,true)
//轮播图修改
export const bannerEdit = data => post('/banneredit', data,true)
//轮播图列表(获取一条)
export const bannerInfo = data => get('/bannerinfo', data,true)
//轮播图删除
export const bannerDel = data => post('/bannerdelete', data)
/* =========限时秒杀管理接口=========== */
//限时秒杀的添加
export const seckadd = (data)=>post('/seckadd',data)
//限时秒杀根据二级分类id获取商品
export const getgoodslistbysid = (data)=>get('/getgoodslistbysid',data)
//限时秒杀列表
export const secklist = ()=>get('/secklist')
//限时秒杀获取一条
export const seckinfo = data=>get('/seckinfo',data)
//限时秒杀修改
export const seckedit = data=>post('/seckedit',data)
//限时秒杀删除
export const seckdelete = data=>post('/seckdelete',data)